-
Notifications
You must be signed in to change notification settings - Fork 181
[BugFix] Fix relevance query function over optimization issue in ReduceExpressionsRule #3851
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BugFix] Fix relevance query function over optimization issue in ReduceExpressionsRule #3851
Conversation
…nsRule Signed-off-by: Songkan Tang <[email protected]>
Signed-off-by: Songkan Tang <[email protected]>
| * @param isDeterministic Specified isDeterministic flag | ||
| * @return Calcite SqlUserDefinedFunction | ||
| */ | ||
| default SqlUserDefinedFunction toUDF(String functionName, boolean isDeterministic) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you combine the methods toUDF in L35? We don't want to keep diff implementations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
| + TEST_INDEX_BEER | ||
| + " | STATS count(AcceptedAnswerId) as idCount" | ||
| + " | WHERE simple_query_string(['Tags'], 'taste') and idCount > 200"; | ||
| + " | EVAL answerId = AcceptedAnswerId + 1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why we change this IT case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because I think the previous test case semantic is ambiguous simple_query_string can't query on target field right after an aggregation. Use eval operator to simulate a filter that can't be pushed down makes a lot sense.
| } | ||
| } | ||
|
|
||
| private static RexNode derefMapCall(RexNode rexNode) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you move this method to PlanUtil?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Signed-off-by: Songkan Tang <[email protected]>
Signed-off-by: Songkan Tang <[email protected]>
…ceExpressionsRule (#3851) * Fix RelevanceQueryFunction over optimization issue by ReduceExpressionsRule Signed-off-by: Songkan Tang <[email protected]> * Fix PredicateAnalyzerTest Signed-off-by: Songkan Tang <[email protected]> * Address comments Signed-off-by: Songkan Tang <[email protected]> * Fix spotless check Signed-off-by: Songkan Tang <[email protected]> --------- Signed-off-by: Songkan Tang <[email protected]> (cherry picked from commit fed92a3) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…ceExpressionsRule (#3851) (#3858) * Fix RelevanceQueryFunction over optimization issue by ReduceExpressionsRule * Fix PredicateAnalyzerTest * Address comments * Fix spotless check --------- (cherry picked from commit fed92a3) Signed-off-by: Songkan Tang <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Description
Fix relevance query function over optimization issue in ReduceExpressionsRule
Related Issues
Related to #3834
Check List
--signoff.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.